﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Microsoft.Practices.Unity;
using ActionServices;
using EntityData;
using System.Web.Mvc;
namespace RegisterService
{
   public class RegisterServices
    {
       public static void RegisterDependencyResolver()
       {
           var container = new UnityContainer();
           container.RegisterType<IusersEntity, usersEntity>(new HttpContextLifetimeManager<IusersEntity>());
           container.RegisterType<IusersActionService, usersActionService>(new HttpContextLifetimeManager<IusersActionService>());

           container.RegisterType<Iuser_groupEntity, user_groupEntity>(new HttpContextLifetimeManager<Iuser_groupEntity>());
           container.RegisterType<Iuser_groupActionService, user_groupActionService>(new HttpContextLifetimeManager<Iuser_groupActionService>());

           container.RegisterType<IvwusersEntity, vwusersEntity>(new HttpContextLifetimeManager<IvwusersEntity>());
           container.RegisterType<IvwusersActionService, vwusersActionService>(new HttpContextLifetimeManager<IvwusersActionService>());

           container.RegisterType<IaccountEntity, accountEntity>(new HttpContextLifetimeManager<IaccountEntity>());
           container.RegisterType<IaccountActionService, accountActionService>(new HttpContextLifetimeManager<IaccountActionService>());

           container.RegisterType<IaccountconfigEntity, accountconfigEntity>(new HttpContextLifetimeManager<IaccountconfigEntity>());
           container.RegisterType<IaccountconfigActionService, accountconfigActionService>(new HttpContextLifetimeManager<IaccountconfigActionService>());
           
           container.RegisterType<IconfirmEntity, confirmEntity>(new HttpContextLifetimeManager<IconfirmEntity>());
           container.RegisterType<IconfirmActionService, confirmActionService>(new HttpContextLifetimeManager<IconfirmActionService>());

           container.RegisterType<IextraworkEntity, extraworkEntity>(new HttpContextLifetimeManager<IextraworkEntity>());
           container.RegisterType<IextraworkActionService, extraworkActionService>(new HttpContextLifetimeManager<IextraworkActionService>());

           container.RegisterType<IgetmoneyEntity, getmoneyEntity>(new HttpContextLifetimeManager<IgetmoneyEntity>());
           container.RegisterType<IgetmoneyActionService, getmoneyActionService>(new HttpContextLifetimeManager<IgetmoneyActionService>());

           container.RegisterType<IjobEntity, jobEntity>(new HttpContextLifetimeManager<IjobEntity>());
           container.RegisterType<IjobActionService, jobActionService>(new HttpContextLifetimeManager<IjobActionService>());


           container.RegisterType<IlogEntity, logEntity>(new HttpContextLifetimeManager<IlogEntity>());
           container.RegisterType<IlogActionService, logActionService>(new HttpContextLifetimeManager<IlogActionService>());


           container.RegisterType<ImediaEntity, mediaEntity>(new HttpContextLifetimeManager<ImediaEntity>());
           container.RegisterType<ImediaActionService, mediaActionService>(new HttpContextLifetimeManager<ImediaActionService>());

           container.RegisterType<ImediaworkEntity, mediaworkEntity>(new HttpContextLifetimeManager<ImediaworkEntity>());
           container.RegisterType<ImediaworkActionService, mediaworkActionService>(new HttpContextLifetimeManager<ImediaworkActionService>());

           container.RegisterType<ImenuEntity, menuEntity>(new HttpContextLifetimeManager<ImenuEntity>());
           container.RegisterType<ImenuActionService, menuActionService>(new HttpContextLifetimeManager<ImenuActionService>());

           container.RegisterType<ImessageEntity, messageEntity>(new HttpContextLifetimeManager<ImessageEntity>());
           container.RegisterType<ImessageActionService, messageActionService>(new HttpContextLifetimeManager<ImessageActionService>());

           container.RegisterType<ImoneyEntity, moneyEntity>(new HttpContextLifetimeManager<ImoneyEntity>());
           container.RegisterType<ImoneyActionService, moneyActionService>(new HttpContextLifetimeManager<ImoneyActionService>());

           container.RegisterType<ItransactionEntity, transactionEntity>(new HttpContextLifetimeManager<ItransactionEntity>());
           container.RegisterType<ItransactionActionService, transactionActionService>(new HttpContextLifetimeManager<ItransactionActionService>());

           container.RegisterType<IuserinfoEntity, userinfoEntity>(new HttpContextLifetimeManager<IuserinfoEntity>());
           container.RegisterType<IuserinfoActionService, userinfoActionService>(new HttpContextLifetimeManager<IuserinfoActionService>());

           container.RegisterType<IwishlistEntity, wishlistEntity>(new HttpContextLifetimeManager<IwishlistEntity>());
           container.RegisterType<IwishlistActionService, wishlistActionService>(new HttpContextLifetimeManager<IwishlistActionService>());

           container.RegisterType<IworkEntity, workEntity>(new HttpContextLifetimeManager<IworkEntity>());
           container.RegisterType<IworkActionService, workActionService>(new HttpContextLifetimeManager<IworkActionService>());




           System.Web.Mvc.DependencyResolver.SetResolver(new DependencyResolver(container));
       }
    }
}
